<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Record extends Base
{
    protected $guarded = [];

    public function challengeMember() {
        return $this->belongsTo('App\Models\Member', 'challenge_member_id');
    }

    public function scopeMemberRecord($query, $memberId)
    {
        return $query->where('victory_member_id', $memberId)->orWhere('defeated_member_id', $memberId);
    }
}
